package iPod;

import java.io.IOException;
import java.io.RandomAccessFile;
import java.util.ArrayList;

public class TrackList extends DataList
{
	ArrayList<TrackItem> tracklist = new ArrayList<TrackItem>();
	
	public TrackList()
	{
		expectedID = "mhlt";
	}
	
	public void readChild(IDBChunk chunk, RandomAccessFile in) throws Exception
    {
		if (chunk.typeID.equalsIgnoreCase("mhit"))
		{
			TrackItem item = new TrackItem();
			item.load(in);
			
			tracklist.add(item);			
		}
		else
		{
			super.readChild(chunk, in);
		}
    }

	public ArrayList<TrackItem> getTracklist() {
		return tracklist;
	}
}

